/* model */
import { SelectUserLabel, SelectUserComponentRole, SelectUserComponentProjectTeam, SelectUserComponentServiceProvider, SelectUserState, BaseSelectUserSearchMoreTypeEnum, BaseSelectUserPropsOptions, BaseBindTabInfoOptions } from '@src/component/common/BaseSelectUser/model'
import { BaseSelectUserUserListKeyEnum, BaseSelectUserLoadingKeyEnum, BaseSelectUserFilterNeedUpdateKeyEnum } from '@src/component/common/BaseSelectUser/store/model'
/* types */
import { 
  BaseSelectUserFilterDepartmentForm, 
  BaseSelectUserFilterRoleForm, 
  BaseSelectUserFilterServiceProviderForm,
  BaseSelectUserGetDepartmentListModel,
  BaseSelectUserGetDepartmentUserListModel,
  BaseSelectUserGetRoleListModel, 
  BaseSelectUserGetRoleUserListModel, 
  BaseSelectUserGetSearchMoreUserListModel, 
  BaseSelectUserGetServiceProviderListModel, 
  BaseSelectUserGetServiceProviderUserListModel,
  BaseSelectUserGetProjectTeamListModel, 
  BaseSelectUserMark, 
  BaseSelectUserSelectedItemType, 
  SelectUserServiceProviderQualificationType 
} from '@src/component/common/BaseSelectUser/types'
import { SelectUserComponentDepartment, SelectUserComponentUser } from '@src/component/common/BaseSelectUser/model'

type BaseSelectUserStoreType<
  StateType extends Record<string, any>,
  MutationsType extends Record<string, any>, 
  ActionsType extends Record<string, any>
> = {
  state: StateType,
  mutations: MutationsType,
  actions: ActionsType
}

// 部门数据
type BaseSelectUserStoreDepartmentDataType = {
  // 根部门列表
  departmentRootList: SelectUserComponentDepartment[];
  // 部门列表
  departmentList: SelectUserComponentDepartment[];
  // 人员列表
  userList: SelectUserComponentUser[];
}

// 选人组件仓库 用户列表数据类型
type BaseSelectUserStoreUserListMapDataType = SelectUserComponentUser[];

// 选人组件仓库 用户数量数据类型
type BaseSelectUserStoreUserCountMapDataType = number;

// 选人组件仓库 加载状态数据类型
type BaseSelectUserStoreLoadingMapDataType = boolean | null;

type BaseSelectUserStoreFilterNeedUpdateMapDateType = boolean;

// 选人组件仓库 用户列表对象类型
type BaseSelectUserStoreUserListMapType = Record<BaseSelectUserUserListKeyEnum, BaseSelectUserStoreUserListMapDataType>;

// 选人组件仓库 用户数量对象类型
type BaseSelectUserStoreUserCountMapType = Record<BaseSelectUserUserListKeyEnum, BaseSelectUserStoreUserCountMapDataType>;

// 选人组件仓库 加载状态对象类型
type BaseSelectUserStoreLoadingMapType = Record<BaseSelectUserLoadingKeyEnum, BaseSelectUserStoreLoadingMapDataType>;

type BaseSelectUserStoreFilterNeedUpdateMapType = Record<BaseSelectUserFilterNeedUpdateKeyEnum, BaseSelectUserStoreFilterNeedUpdateMapDateType>;

type BaseSelectUserStoreSelectUserListDataType = {
  // 组织架构人员列表
  organizationUserList: SelectUserComponentUser[];
  // 服务商人员列表
  serviceProviderUserList: SelectUserComponentUser[];
};

type BaseSelectUserStoreStateType = {
  CustomOptions: BaseSelectUserPropsOptions | any ;
  DynamicTabName: string
  // 选人控件的查询标签列表
  markList: BaseSelectUserMark[];
  // 当前选人控件选中的标签页类型
  currentTabType: string;
  // 部门数据
  departmentData: BaseSelectUserStoreDepartmentDataType;
  // 用户工作状态列表
  userStateList: SelectUserState[];
  // 人员标签列表
  userLabelList: SelectUserLabel[];
  // 人员列表对象
  userListMap: BaseSelectUserStoreUserListMapType;
  // 人员数量对象
  userCountMap: BaseSelectUserStoreUserCountMapType;
  // 加载状态对象
  loadingMap: BaseSelectUserStoreLoadingMapType;
  filterNeedUpdateMap: BaseSelectUserStoreFilterNeedUpdateMapType,
  // 角色列表
  roleList: SelectUserComponentRole[];
  // 项目列表
  projectTeamList: SelectUserComponentProjectTeam[];
  // 服务商列表
  serviceProviderList: SelectUserComponentServiceProvider[];
  // 服务商资质列表
  serviceProviderQualificationList: SelectUserServiceProviderQualificationType[];
  // 当前列表展开查看的角色
  currentToggleRole: SelectUserComponentRole | null;
  // 当前列表展开查看的项目
  currentToggleProjectTeam: SelectUserComponentProjectTeam | null;
  // 当前列表展开查看的服务商
  currentToggleServiceProvider: SelectUserComponentServiceProvider | null;
  // 搜索人员数据
  searchUserListData: BaseSelectUserStoreSelectUserListDataType;
  // 筛选 - 部门表单
  filterDepartmentForm: BaseSelectUserFilterDepartmentForm; 
  // 筛选 - 角色表单
  filterRoleForm: BaseSelectUserFilterRoleForm;
  // 筛选 - 服务商表单
  filterServiceProviderForm: BaseSelectUserFilterServiceProviderForm;
  // 服务商类型列表
  serviceProviderTypeList: SelectUserServiceProviderQualificationType[];
  // 部门面包屑导航列表
  departmentNavList: SelectUserComponentDepartment[];
  // 当前部门导航
  currentDepartmentNav: SelectUserComponentDepartment | null;
  // 已选中列表
  checkedItemList: BaseSelectUserSelectedItemType[];
  // 查询部门人员列表参数
  departmentUserListParams: BaseSelectUserGetDepartmentUserListModel;
  // 查询部门列表参数
  departmentListParams: BaseSelectUserGetDepartmentListModel;
  // 查询角色人员列表参数
  roleUserListParams: BaseSelectUserGetRoleUserListModel;
  // 查询角色列表参数
  roleListParams: BaseSelectUserGetRoleListModel;
  // 服务商面包屑导航列表
  serviceProviderNavList: SelectUserComponentServiceProvider[];
  // 当前服务商导航
  currentServiceProviderNav: SelectUserComponentServiceProvider | null;
  // 查询服务商人员列表参数
  serviceProviderUserListParams: BaseSelectUserGetServiceProviderUserListModel;
  // 查询服务商列表参数
  serviceProviderListParams: BaseSelectUserGetServiceProviderListModel;
  // 查询搜索更多人员列表参数
  searchMoreUserListParams: BaseSelectUserGetSearchMoreUserListModel;
  // 搜索关键字
  keyword: string;
  // 当前搜索更多类型
  currentSearchMoreType: BaseSelectUserSearchMoreTypeEnum | null;
  isSearchOrganizationHasMore: boolean;
  isSearchSpHasMore: boolean;
  isFilterVisible: boolean;
  options: BaseSelectUserPropsOptions | undefined;
  // 当前组件与tab绑定的列表
  bindTabInfo: BaseBindTabInfoOptions; 
}

export type {
  BaseSelectUserStoreStateType,
  BaseSelectUserStoreType,
  BaseSelectUserStoreDepartmentDataType,
  BaseSelectUserStoreUserListMapType,
  BaseSelectUserStoreUserListMapDataType,
  BaseSelectUserStoreUserCountMapDataType,
  BaseSelectUserStoreUserCountMapType,
  BaseSelectUserStoreSelectUserListDataType,
  BaseSelectUserStoreLoadingMapType,
  BaseSelectUserStoreLoadingMapDataType,
  BaseSelectUserStoreFilterNeedUpdateMapType,
  BaseSelectUserStoreFilterNeedUpdateMapDateType
}

